package com.example.panda.adapter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

public class SquareAdapter extends FragmentPagerAdapter {

    List<Fragment> squarefragmentList=new ArrayList<>();
    List<String> list_title=new ArrayList<>();

    public SquareAdapter(@NonNull FragmentManager fm, List<Fragment> fragmentList, List<String> list_title) {
        super(fm);
        this.squarefragmentList = fragmentList;
        this.list_title = list_title;
    }



    @NonNull
    @Override
    public Fragment getItem(int position) {
        return squarefragmentList.get(position);
    }

    @Override
    public int getCount() {
        return squarefragmentList.size();
    }

    @Override
    public CharSequence getPageTitle(int position){
        return list_title.get(position);
    }
}
